<?php if (!defined('THINK_PATH')) exit(); /*a:2:{s:71:"/data/www/sfadmin/public/../application/admin/view/auth_rule/index.html";i:1490856818;s:69:"/data/www/sfadmin/public/../application/admin/view/template/base.html";i:1488527668;}*/ ?>
﻿<head>
    <link rel="stylesheet" type="text/css" href="__STATIC__/h-ui/css/H-ui.min.css"/>
    <link rel="stylesheet" type="text/css" href="__STATIC__/h-ui.admin/css/H-ui.admin.css"/>
    <link rel="stylesheet" type="text/css" href="__LIB__/Hui-iconfont/1.0.7/iconfont.css"/>
    <link rel="stylesheet" type="text/css" href="__STATIC__/h-ui.admin/css/style.css"/>
    <link rel="stylesheet" type="text/css" href="__STATIC__/css/app.css"/>
    
</head>
<body>

<nav class="breadcrumb">
    <div id="nav-title"></div>
    <!-- <a class="btn btn-success radius r btn-refresh" style="line-height:1.6em;margin-top:3px" href="javascript:;" title="刷新"><i class="Hui-iconfont"></i></a> -->
</nav>



<div class="pd-10 mt-30">
	<div class="cl pd-5 bg-1 bk-gray"> 
		<?php if(showAuth('admin/AuthRule/add')): ?>
			<span class="l">
				<a class="btn btn-primary radius add-btn" data-title="添加顶级规则" data-url="<?php echo url('add',['pid'=>0]); ?>" href="javascript:;"><i class="Hui-iconfont">&#xe600;</i> 添加顶级规则</a>
			</span> 
		<?php endif; ?>
	</div>
	<table class="table table-border table-bordered table-hover table-bg table-sort">
		<thead>
			<tr>
				<th scope="col" colspan="6" class="text-c"><h3>规则列表</h3></th>
			</tr>
			<tr class="text-c">
				<th width="20%"><h4>规则描述</h4></th>
				<th width="30%"><h4>规则名</h4></th>
				<th width="25%"><h4>附加规则</h4></th>
				<th width="5%"><h4>状态</h4></th>
				<th width="20%"><h4>操作</h4></th>
			</tr>
		</thead>
		<?php if(is_array($data) || $data instanceof \think\Collection): $i = 0; $__LIST__ = $data;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$v): $mod = ($i % 2 );++$i;if($v['pid'] == 0): ?>
				<tbody>
					<td class="danger"><strong><?php echo $v['title']; ?></strong></td>
					<td class="danger"><strong><?php echo $v['name']; ?></strong></td>
					<td class="danger"><strong><?php echo !empty($v['condition'])?$v['condition'] : '<mark>没有设置附加规则</mark>'; ?></strong></td>
					<td class="danger"><strong><?php echo !empty($v['status'])?'<span class="label label-success radius">启用</span>' : '<span class="label label-danger radius">禁用</span>'; ?></strong></td>
					<td >
						<?php if(showAuth('admin/AuthRule/add')): ?>
							<input class="btn btn-primary  radius  size-S add-btn" type="button" data-url="<?php echo url('add',['pid'=>$v['id']]); ?>" data-title="添加子规则" value="添加子规则">
						<?php endif; if(showAuth('admin/AuthRule/edit')): ?>
							<input class="btn btn-default  radius  size-S edit-btn" data-url="<?php echo url('edit',['id'=>$v['id']]); ?>" type="button" data-title="编辑规则:<?php echo $v['title']; ?>" value="编辑">
						<?php endif; if(showAuth('admin/AuthRule/delete')): ?>
							<input class="btn btn-danger radius  size-S delete-btn" data-url="<?php echo url('delete'); ?>" data-id="<?php echo $v['id']; ?>" type="button" value="删除">
						<?php endif; ?>
					</td>
				</tbody>
					<?php if(is_array($data) || $data instanceof \think\Collection): $i = 0; $__LIST__ = $data;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$v1): $mod = ($i % 2 );++$i;if($v1['pid'] == $v['id']): ?>
							<tbody>
								<td>|———— <?php echo $v1['title']; ?></td>
								<td><?php echo $v1['name']; ?></td>
								<td><?php echo !empty($v1['condition'])?$v1['condition'] : '<mark>没有设置附加规则</mark>'; ?></td>
								<td><?php echo !empty($v1['status'])?'<span class="label label-success radius">启用</span>' : '<span class="label label-danger radius">禁用</span>'; ?></td>
								<td>
									<?php if(showAuth('admin/AuthRule/edit')): ?>
										<input class="btn btn-default  radius  size-S edit-btn" data-url="<?php echo url('edit',['id'=>$v1['id']]); ?>" type="button" data-title="编辑规则:<?php echo $v1['title']; ?>" value="编辑">
									<?php endif; if(showAuth('admin/AuthRule/delete')): ?>
										<input class="btn btn-danger radius  size-S delete-btn" data-url="<?php echo url('delete'); ?>" data-id="<?php echo $v1['id']; ?>" type="button" value="删除">
									<?php endif; ?>
								</td>
							</tbody>
						<?php endif; endforeach; endif; else: echo "" ;endif; endif; endforeach; endif; else: echo "" ;endif; ?>
	</table>
</div>


<script type="text/javascript">
    var PUBLIC = '__PUBLIC__';
    var REQUIRE__JS = '__REQUIRE__JS__';
</script>
<!--require Js -->
<script src="__REQUIRE__JS__/require.config.js"></script>
<script src="__REQUIRE__JS__/require.js"></script>
<script src="__PUBLIC__/common/js/functions.js"></script>

	<script type="text/javascript" src="__AJS__/auth_rule/index.js"></script>

</body>
